{\rtf1\ansi\ansicpg1252\cocoartf1138
{\fonttbl\f0\fswiss\fcharset0 Helvetica;\f1\fnil\fcharset0 Verdana;}
{\colortbl;\red255\green255\blue255;}
\paperw11900\paperh16840\margl1440\margr1440\vieww10800\viewh8400\viewkind0
\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural

\f0\fs24 \cf0 CREATE TABLE Usuario\
       (    idUsuario    numeric(10)     not null, \
            nome         varchar2(50)    not null,\
            login        varchar2(10)    not null,\
            senha        varchar2(10)    not null,\
           data            date                         not null,\
            CONSTRAINT pk_usuario PRIMARY KEY (idUsuario)\
       );   \
\
create sequence SQ_Usuario increment by 1 start with 1;\
\
\
\
CREATE TABLE Noticia\
       (      idNoticia      numeric(10)     not null,\
              idUsuario      numeric(10)     not null,\
              titulo         varchar2(50)    not null,\
              descricao      varchar2(50)    not null,\
              link           varchar2(50),\
              data           date            not null,\
              CONSTRAINT pk_noticia PRIMARY KEY (idNoticia),              \
              CONSTRAINT fk_usuario\
                FOREIGN KEY (idUsuario)\
                REFERENCES Usuario(idUsuario)\
       );\
\
create sequence SQ_Noticia increment by 1 start with 1;\
\
Exemplo de uso \
\
\pard\pardeftab720

\f1\fs18 \cf0 Insere os registros na tabela, colocando autom\'e1ticamente o pr\'f3ximo valor\
--dispon\'edvel na tabela em quest\'e3o atrav\'e9s da Sequence criada. \'c9 s\'f3 substituir \
--os outros dados por vari\'e1veis\
INSERT INTO tb_agenda ( \
		id_agenda, \
		s_Nome,\
		s_Tel,\
		s_Email)\
	VALUES (\
		SQ_AGENDA.NEXTVAL,\
		'Cristiano Heringer',\
		'(11) 3333-2222',\
		'cristiano@iheringer.com.br')\
\
Para exibir a data formatada: select to_char (data, 'dd/mm/yy hh24:mi') from usuario\
\
alter table noticia modify descricao varchar2 (100);\
}